require('./response');
const Database = require('../../utils/mysql');

exports.get = async (req, res) => {
  let db;
  try {
    db = new Database();
    // 插入一条新记录
    await db.insert('user', { username: 'Alice' });
    res.success({ msg : "添加成功" });
  } catch (error) {
    res.error({error})
  }
  finally{
    await db.close();
  }
};